/*
 * @Description: 公共实体
 * @Author: Haor
 * @Date: 2022-04-06 21:31:31
 * @LastEditTime: 2022-05-07 12:55:49
 * @LastEditors: Haor
 */

import { Column, Entity, PrimaryColumn } from 'typeorm'
import { PublicEntity } from './public.entity'

/**
 * 字典列表实体
 */
@Entity({ name: 'sys_dict' }) //数据表的名字
export class Dict extends PublicEntity {
	@Column({ comment: '字典名称' })
	name: string

	@Column({ comment: '字典描述' })
	description: string

    @Column({ comment: '删除状态：（0.未删除，1.已删除）', name: 'is_delete', select: false })
    isDelete: number
}

/**
 * 字典详情实体
 */
@Entity({
    name: 'sys_dict_detail',
    orderBy:{
        sort: 'ASC'
    }
}) //数据表的名字
export class DictDetail extends PublicEntity {
	@Column({ name: 'dict_id', comment: '字典ID' })
	dictId: number

	@Column({ comment: '字典名称' })
	label: string

	@Column({ comment: '字典值' })
	value: string

	@Column({ comment: '排序值' })
	sort: number

    @Column({ comment: '删除状态：（0.未删除，1.已删除', name: 'is_delete'})
    isDelete: number
}
